SLIAudioPlayer.checkStreamCallback

Checking some bug issues tracker: - https://groups.google.com/g/android-ndk/c/zANdS2n2cQI

- https://issuetracker.google.com/issues/37011991

It seems that you can't make any call to OpenSL API inside SL_PLAYEVENT_HEADATEND

I'm delegating it right now to the void update() method. As it seems, there is a little more music playing after SL_PLAYEVENT_HEADATEND(it is notified early).

It can cause some unsync in some other device, but that must be checked case-to-case.

Using ushort.max seems to be the way to go about how much it need to decode. ushort.max/4 caused some interruptions in music, while ushort.max/8 was inaudible (ushort.max is a great number, 65k)

It is also possible to bypass the need for a callback by calling GetState and checking if count == 0, that will mean that the head is at the end

struct SLIAudioPlayer
extern (C) static
void
checkStreamCallback

Meta